const express = require('express');
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const wepackDevServer = require('webpack-dev-server');

const app = express();
const config = require('./webpack.config.js');
const options = {
    contentBase: './dist',
    hot: true,
    host: 'localhost',
    publicPath: config.output.publicPath
}

wepackDevServer.addDevServerEntryOptions(config, options);
const compiler = webpack(config);

app.use(webpackDevMiddleware(compiler,options));

// app.listen(3000, function(){
//     console.log('Example app listening on port 3000!\n')
// })
app.listen(5000, 'localhost',()=>{
    console.log('125315');
})